package com.hqyj.onlineExamination.modules.exam.controller;

import com.hqyj.onlineExamination.modules.common.entity.ResultEntity;
import com.hqyj.onlineExamination.modules.exam.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * @author yun
 * @date 2021-5-25 15:08
 */
@Controller
@RequestMapping("/exam")
public class ExamController {

    @Autowired
    private QuestionService questionService;

    /**
     * 127.0.0.1/exam/questions ---- get
     */
    @GetMapping("/questions")
    public String questionsPage(){
        return "index";
    }

    /**
     * 试卷页面
     * 127.0.0.1/exam/testPaper
     */
    @GetMapping("/testPaper")
    public String testPaper(@RequestParam Integer id,@RequestParam Integer uId, Model model){
        model.addAttribute("paperId",id);
        model.addAttribute("userId",uId);
        return "exam/testPaper";
    }

    /**
     * 127.0.0.1:81/exam/papers ---- get
     */
    @GetMapping("/papers")
    public String papersPage() {
        return "index";
    }

    //考试结果页面
    @GetMapping("/achievementPaper")
    public  String achievementPaper(@RequestParam Integer id, Model model){
        model.addAttribute("achievementId",id);
        return "exam/achievementPaper";
    }

    /**
     * 127.0.0.1/exam/correct ---- get
     */
    @GetMapping("/correct")
    public String correctPage(){
        return "index";
    }

    //批改页面
    @GetMapping("/achievement")
    public  String achievement(@RequestParam Integer id, Model model){
        model.addAttribute("achievementId",id);
        return "exam/achievement";
    }
    //审批试卷页面
    @GetMapping("/approvals")
    public  String approvalPage(){
        return "index";
    }
}
